part of 'component.dart';

class TitleContentItemView extends StatelessWidget {
  const TitleContentItemView({
    Key? key,
    required this.title,
    this.fontSize,
    this.content,
    this.height,
    this.contentStyle,
    this.backgroundColor,
    this.hasArrow = true,
    this.contentWidget,
    this.padding = EdgeInsets.zero,
    this.onTap,
  }) : super(key: key);
  final String title;
  final double? fontSize;
  final String? content;
  final TextStyle? contentStyle;
  final double? height;
  final Color? backgroundColor;
  final EdgeInsets? padding;
  final bool? hasArrow;
  final Widget? contentWidget;
  final VoidCallback? onTap;
  @override
  Widget build(BuildContext context) {
    return InkWell(
        onTap: onTap,
        child: Container(
          padding: padding,
          color: backgroundColor,
          height: height ?? 44.r,
          child: Row(
            children: [
              Expanded(
                  child: Text(
                title,
                style: pfMediumStyle(
                    color: ColorsUtil.title, fontSize: fontSize ?? 15.sp),
              )),
              contentWidget ??
                  Text(
                    content ?? '',
                    style: contentStyle ??
                        pfMediumStyle(
                            color: ColorsUtil.content, fontSize: 13.sp),
                  ),
              Visibility(
                visible: hasArrow == true,
                child: Icon(
                  Icons.arrow_forward_ios_rounded,
                  size: 12.r,
                  color: ColorsUtil.content,
                ),
              )
            ],
          ),
        ));
  }
}
